package com.wms.service.impl;

import com.wms.mapper.CategoryMapper;
import com.wms.pojo.Category;
import com.wms.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private CategoryMapper categoryMapper;
    @Override
    public List<Category> queryAll() {
        List<Category> categories = categoryMapper.queryAll();
        return categories;
    }

    @Override
    public Category queryById(Integer id) {
        Category category = categoryMapper.queryById(id);
        return category;
    }

    @Override
    public Boolean addCategory(Category category) {
        return categoryMapper.addCategory(category);
    }

    @Override
    public Boolean deleteCategory(Integer id) {
        return categoryMapper.deleteCategory(id);
    }

    @Override
    public Boolean updateCategory(Category category) {


        return categoryMapper.updateCategory(category);
    }
}
